using System;
using bitzhuwei.Compiler;

namespace bitzhuwei.GLSLFormat {
    /// <summary>
    /// Correspond to the Vn node declaration in the grammar(GLSL).
    /// </summary>
    internal partial class Vndeclaration : IFullFormat {
        // [088] declaration = function_prototype ';' ;
        // [089] declaration = init_declarator_list ';' ;
        // [090] declaration = 'precision' precision_qualifier type_specifier ';' ;
        // [091] declaration = type_qualifier 'identifier' '{' struct_declaration_list '}' ';' ;
        // [092] declaration = type_qualifier 'identifier' '{' struct_declaration_list '}' 'identifier' ';' ;
        // [093] declaration = type_qualifier 'identifier' '{' struct_declaration_list '}' 'identifier' array_specifier ';' ;
        // [094] declaration = type_qualifier ';' ;
        // [095] declaration = type_qualifier 'identifier' ';' ;
        // [096] declaration = type_qualifier 'identifier' identifier_list ';' ;


        private readonly IFullFormat complex;

        private readonly TokenRange _scope;
        public TokenRange Scope => _scope;
        public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
            context.PrintBlanksAnd(this.complex, preConfig, writer);
        }


        // [088] declaration = function_prototype ';' ;
        public Vndeclaration(Vnfunction_prototype r1, Token r0) {
            this.complex = new complex0(r1, r0);
            this._scope = new TokenRange(r1, r0);
        }
        class complex0 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                var config = new BlankConfig();
                context.PrintBlanksAnd(r1, preConfig, writer);
                context.PrintCommentsBetween(r1, r0, config, writer);
                context.PrintBlanksAnd(r0, config, writer);
            }
            public readonly Vnfunction_prototype r1;
            public readonly Token r0;
            public complex0(Vnfunction_prototype r1, Token r0) {
                this.r1 = r1;
                this.r0 = r0;
                this._scope = new TokenRange(r1, r0);
            }
        }

        // [089] declaration = init_declarator_list ';' ;
        public Vndeclaration(Vninit_declarator_list r1, Token r0) {
            this.complex = new complex1(r1, r0);
            this._scope = new TokenRange(r1, r0);
        }
        class complex1 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                var config = new BlankConfig();
                context.PrintBlanksAnd(r1, preConfig, writer);
                context.PrintCommentsBetween(r1, r0, config, writer);
                context.PrintBlanksAnd(r0, config, writer);
            }
            public readonly Vninit_declarator_list r1;
            public readonly Token r0;
            public complex1(Vninit_declarator_list r1, Token r0) {
                this.r1 = r1;
                this.r0 = r0;
                this._scope = new TokenRange(r1, r0);
            }
        }

        // [090] declaration = 'precision' precision_qualifier type_specifier ';' ;
        public Vndeclaration(Token r3, Vnprecision_qualifier r2, Vntype_specifier r1, Token r0) {
            this.complex = new complex2(r3, r2, r1, r0);
            this._scope = new TokenRange(r3, r0);
        }
        class complex2 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                var config = new BlankConfig();
                context.PrintBlanksAnd(r3, preConfig, writer);
                context.PrintCommentsBetween(r3, r2, config, writer);
                context.PrintBlanksAnd(r2, config, writer);
                context.PrintCommentsBetween(r2, r1, config, writer);
                context.PrintBlanksAnd(r1, config, writer);
                context.PrintCommentsBetween(r1, r0, config, writer);
                context.PrintBlanksAnd(r0, config, writer);
            }
            public readonly Token r3;
            public readonly Vnprecision_qualifier r2;
            public readonly Vntype_specifier r1;
            public readonly Token r0;
            public complex2(Token r3, Vnprecision_qualifier r2, Vntype_specifier r1, Token r0) {
                this.r3 = r3;
                this.r2 = r2;
                this.r1 = r1;
                this.r0 = r0;
                this._scope = new TokenRange(r3, r0);
            }
        }

        // [091] declaration = type_qualifier 'identifier' '{' struct_declaration_list '}' ';' ;
        public Vndeclaration(Vntype_qualifier r5, Token r4, Token r3, Vnstruct_declaration_list r2, Token r1, Token r0) {
            this.complex = new complex3(r5, r4, r3, r2, r1, r0);
            this._scope = new TokenRange(r5, r0);
        }
        class complex3 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                var config = new BlankConfig();
                context.PrintBlanksAnd(r5, preConfig, writer);
                context.PrintCommentsBetween(r5, r4, config, writer);
                context.PrintBlanksAnd(r4, config, writer);
                context.PrintCommentsBetween(r4, r3, config, writer);
                context.PrintBlanksAnd(r3, config, writer);
                context.PrintCommentsBetween(r3, r2, config, writer);
                context.PrintBlanksAnd(r2, config, writer);
                context.PrintCommentsBetween(r2, r1, config, writer);
                context.PrintBlanksAnd(r1, config, writer);
                context.PrintCommentsBetween(r1, r0, config, writer);
                context.PrintBlanksAnd(r0, config, writer);
            }
            public readonly Vntype_qualifier r5;
            public readonly Token r4;
            public readonly Token r3;
            public readonly Vnstruct_declaration_list r2;
            public readonly Token r1;
            public readonly Token r0;
            public complex3(Vntype_qualifier r5, Token r4, Token r3, Vnstruct_declaration_list r2, Token r1, Token r0) {
                this.r5 = r5;
                this.r4 = r4;
                this.r3 = r3;
                this.r2 = r2;
                this.r1 = r1;
                this.r0 = r0;
                this._scope = new TokenRange(r5, r0);
            }
        }

        // [092] declaration = type_qualifier 'identifier' '{' struct_declaration_list '}' 'identifier' ';' ;
        public Vndeclaration(Vntype_qualifier r6, Token r5, Token r4, Vnstruct_declaration_list r3, Token r2, Token r1, Token r0) {
            this.complex = new complex4(r6, r5, r4, r3, r2, r1, r0);
            this._scope = new TokenRange(r6, r0);
        }
        class complex4 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                var config = new BlankConfig();
                context.PrintBlanksAnd(r6, preConfig, writer);
                context.PrintCommentsBetween(r6, r5, config, writer);
                context.PrintBlanksAnd(r5, config, writer);
                context.PrintCommentsBetween(r5, r4, config, writer);
                context.PrintBlanksAnd(r4, config, writer);
                context.PrintCommentsBetween(r4, r3, config, writer);
                context.PrintBlanksAnd(r3, config, writer);
                context.PrintCommentsBetween(r3, r2, config, writer);
                context.PrintBlanksAnd(r2, config, writer);
                context.PrintCommentsBetween(r2, r1, config, writer);
                context.PrintBlanksAnd(r1, config, writer);
                context.PrintCommentsBetween(r1, r0, config, writer);
                context.PrintBlanksAnd(r0, config, writer);
            }
            public readonly Vntype_qualifier r6;
            public readonly Token r5;
            public readonly Token r4;
            public readonly Vnstruct_declaration_list r3;
            public readonly Token r2;
            public readonly Token r1;
            public readonly Token r0;
            public complex4(Vntype_qualifier r6, Token r5, Token r4, Vnstruct_declaration_list r3, Token r2, Token r1, Token r0) {
                this.r6 = r6;
                this.r5 = r5;
                this.r4 = r4;
                this.r3 = r3;
                this.r2 = r2;
                this.r1 = r1;
                this.r0 = r0;
                this._scope = new TokenRange(r6, r0);
            }
        }

        // [093] declaration = type_qualifier 'identifier' '{' struct_declaration_list '}' 'identifier' array_specifier ';' ;
        public Vndeclaration(Vntype_qualifier r7, Token r6, Token r5, Vnstruct_declaration_list r4, Token r3, Token r2, Vnarray_specifier r1, Token r0) {
            this.complex = new complex5(r7, r6, r5, r4, r3, r2, r1, r0);
            this._scope = new TokenRange(r7, r0);
        }
        class complex5 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                var config = new BlankConfig();
                context.PrintBlanksAnd(r7, preConfig, writer);
                context.PrintCommentsBetween(r7, r6, config, writer);
                context.PrintBlanksAnd(r6, config, writer);
                context.PrintCommentsBetween(r6, r5, config, writer);
                context.PrintBlanksAnd(r5, config, writer);
                context.PrintCommentsBetween(r5, r4, config, writer);
                context.PrintBlanksAnd(r4, config, writer);
                context.PrintCommentsBetween(r4, r3, config, writer);
                context.PrintBlanksAnd(r3, config, writer);
                context.PrintCommentsBetween(r3, r2, config, writer);
                context.PrintBlanksAnd(r2, config, writer);
                context.PrintCommentsBetween(r2, r1, config, writer);
                context.PrintBlanksAnd(r1, config, writer);
                context.PrintCommentsBetween(r1, r0, config, writer);
                context.PrintBlanksAnd(r0, config, writer);
            }
            public readonly Vntype_qualifier r7;
            public readonly Token r6;
            public readonly Token r5;
            public readonly Vnstruct_declaration_list r4;
            public readonly Token r3;
            public readonly Token r2;
            public readonly Vnarray_specifier r1;
            public readonly Token r0;
            public complex5(Vntype_qualifier r7, Token r6, Token r5, Vnstruct_declaration_list r4, Token r3, Token r2, Vnarray_specifier r1, Token r0) {
                this.r7 = r7;
                this.r6 = r6;
                this.r5 = r5;
                this.r4 = r4;
                this.r3 = r3;
                this.r2 = r2;
                this.r1 = r1;
                this.r0 = r0;
                this._scope = new TokenRange(r7, r0);
            }
        }

        // [094] declaration = type_qualifier ';' ;
        public Vndeclaration(Vntype_qualifier r1, Token r0) {
            this.complex = new complex6(r1, r0);
            this._scope = new TokenRange(r1, r0);
        }
        class complex6 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                var config = new BlankConfig();
                context.PrintBlanksAnd(r1, preConfig, writer);
                context.PrintCommentsBetween(r1, r0, config, writer);
                context.PrintBlanksAnd(r0, config, writer);
            }
            public readonly Vntype_qualifier r1;
            public readonly Token r0;
            public complex6(Vntype_qualifier r1, Token r0) {
                this.r1 = r1;
                this.r0 = r0;
                this._scope = new TokenRange(r1, r0);
            }
        }

        // [095] declaration = type_qualifier 'identifier' ';' ;
        public Vndeclaration(Vntype_qualifier r2, Token r1, Token r0) {
            this.complex = new complex7(r2, r1, r0);
            this._scope = new TokenRange(r2, r0);
        }
        class complex7 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                var config = new BlankConfig();
                context.PrintBlanksAnd(r2, preConfig, writer);
                context.PrintCommentsBetween(r2, r1, config, writer);
                context.PrintBlanksAnd(r1, config, writer);
                context.PrintCommentsBetween(r1, r0, config, writer);
                context.PrintBlanksAnd(r0, config, writer);
            }
            public readonly Vntype_qualifier r2;
            public readonly Token r1;
            public readonly Token r0;
            public complex7(Vntype_qualifier r2, Token r1, Token r0) {
                this.r2 = r2;
                this.r1 = r1;
                this.r0 = r0;
                this._scope = new TokenRange(r2, r0);
            }
        }

        // [096] declaration = type_qualifier 'identifier' identifier_list ';' ;
        public Vndeclaration(Vntype_qualifier r3, Token r2, Vnidentifier_list r1, Token r0) {
            this.complex = new complex8(r3, r2, r1, r0);
            this._scope = new TokenRange(r3, r0);
        }
        class complex8 : IFullFormat {
            private readonly TokenRange _scope;
            public TokenRange Scope => _scope;
            public void FullFormat(BlankConfig? preConfig, TextWriter writer, FormatContext context) {
                var config = new BlankConfig();
                context.PrintBlanksAnd(r3, preConfig, writer);
                context.PrintCommentsBetween(r3, r2, config, writer);
                context.PrintBlanksAnd(r2, config, writer);
                context.PrintCommentsBetween(r2, r1, config, writer);
                context.PrintBlanksAnd(r1, config, writer);
                context.PrintCommentsBetween(r1, r0, config, writer);
                context.PrintBlanksAnd(r0, config, writer);
            }
            public readonly Vntype_qualifier r3;
            public readonly Token r2;
            public readonly Vnidentifier_list r1;
            public readonly Token r0;
            public complex8(Vntype_qualifier r3, Token r2, Vnidentifier_list r1, Token r0) {
                this.r3 = r3;
                this.r2 = r2;
                this.r1 = r1;
                this.r0 = r0;
                this._scope = new TokenRange(r3, r0);
            }
        }



    }
}
